#!/usr/bin/env bash
set -e

username=""

while [ $# -gt 0 ]; do
  case "$1" in
    -u)
      username="$2"
      shift
      ;;
    --*)
      echo "Illegal option $1"
      ;;
  esac
  shift $(( $# > 0 ? 1 : 0 ))
done

__dirname="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source="ssh:\/\/openai-corp.rokid.com:29418"
target="ssh:\/\/${username}@openai-corp.rokid.com:29418"

sed -i -e "s/${source}/${target}/g" ${__dirname}/../manifest.xml

